package lunchy.data.classes;

import java.util.ArrayList;
import java.util.List;

import lunchy.data.interfaces.ILunchyMenuGroup;
import lunchy.data.interfaces.ILunchyMenuItem;

public class CLunchyMenuGroup implements ILunchyMenuGroup
{
	private List<ILunchyMenuItem> items = new ArrayList<ILunchyMenuItem>(0);
	private Integer id = 0;
	private String name = "";
	
	public CLunchyMenuGroup()
	{

	}
	
	public CLunchyMenuGroup(Integer id, String name)
	{
		this.name = name;
		this.id = id;
	}

	public boolean addMenuGroupItem(ILunchyMenuItem item)
	{
		if(item != null)
		{
			item.setGroupID(id);
			items.add(item);
			return true;
		}
		else
		{
			return false;
		}
	}

	public List<ILunchyMenuItem> getItems()
	{
		return items;
	}
	
	public void setItems(List<ILunchyMenuItem> items)
	{
		this.items = items;
	}

	public String getName()
	{
		return name;
	}
	
	public void setName(String name)
	{
		this.name = name;
	}

	public Integer getId()
	{
		return id;
	}
	
	public void setId(Integer id)
	{
		this.id = id;
	}


	public Integer getMenuGroupItemsCount()
	{
		return items.size();
	}
}